a = [6, 1, 2, 5, 4, 3, 9, 7, 10, 8]
def quick_sorting(left, right):
    global a
    if left > right:
        return

    t = a[left]
    i = left
    j = right
    while(i != j):
        while(a[j] >= t and i < j):
            j -= 1
        while(a[i] <= t and i < j):
            i += 1
        if i < j:
            a[i], a[j] = a[j], a[i]
    
    a[left] = a[i]
    a[i] = t
    quick_sorting(left, i - 1)
    quick_sorting(i + 1, right)

print(a)
quick_sorting(0, len(a) - 1)
print(a)